import { Button, Image, Tag } from "antd";
const columns = (ctx) => {
  return [
    {
      title: "商品名称",
      dataIndex: "proname",
      key: "proname",
      ellipsis: true,
      width: 200,
      align: "center",
      editable: true,
    },
    {
      title: "图片",
      dataIndex: "img1",
      key: "img1",
      width: 150,
      align: "center",
      render: (text) => <Image width={100} src={text} />,
    },
    {
      title: "品牌",
      dataIndex: "brand",
      key: "brand",
      render: (text) => (
        <Tag color="cyan">
          <a href="#"> {text} </a>{" "}
        </Tag>
      ),
      align: "center",
    },
    {
      title: "专享价格",
      dataIndex: "originprice",
      key: "originprice",
      width: 120,
      align: "center",
      render: (text) => <h1 style={{ color: "red" }}> {text} </h1>,
    },
    {
      title: "已售数量",
      dataIndex: "sales",
      key: "sales",
      align: "center",
    },
    {
      title: "操作",
      width: 200,
      render: (_, record) => (
        <>
          {" "}
          <Button type="default" onClick={() => ctx.handeCheck(record.proid)}>
            查看{" "}
          </Button>{" "}
          <Button type="primary"> 编辑 </Button>{" "}
        </>
      ),
    },
  ];
};
export default columns;
